import { defineStore } from "pinia";

interface Jurisdiction{
  pageInfoList : any,
  sex: string,
  status: string,
  tenantId: string,
  userId: string,
  userName: string,
  userType: string,
  createTime: string,
  loginDate: string,

}

const jurisdiction = defineStore("Jurisdiction", {
  state: (): Jurisdiction => {
    return {
      pageInfoList:[],
      sex: '',
      status: '',
      tenantId: '',
      userId: '',
      userName: '',
      userType: '',
      createTime: '',
      loginDate: '',
    }
  },
  actions: {
    setState(data) {
      this.pageInfoList = data
    },
    setSex(data){
      this.sex  = data.sex
      this.status  = data.status
      this.tenantId  = data.tenantId
      this.userId  = data.userId
      this.userName  = data.userName
      this.userType  = data.userType
      this.createTime  = data.createTime
      this.loginDate  = data.loginDate
    },
    // 在 jurisdiction 的 actions 中添加
    resetState() {
      this.pageInfoList = [];
      this.sex = '';
      this.status = '';
      this.tenantId = '';
      this.userId = '';
      this.userName = '';
      this.userType = '';
      this.createTime = '';
      this.loginDate = '';
    }
  },
});

export default jurisdiction;